package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.MemberProductTime;
import cn.wolfcode.crm.mapper.MemberProductTimeMapper;
import cn.wolfcode.crm.query.PageResult;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.IMemberProductTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberProductTimeServiceImpl implements IMemberProductTimeService{
    @Autowired
    private MemberProductTimeMapper mapper;

    public PageResult queryPage(QueryObject qo) {
        PageResult pr = new PageResult();
        int total = mapper.queryForCount(qo);
        if (total == 0) {
            return pr;
        }
        List<MemberProductTime> rows = mapper.queryForList(qo);
        pr.setTotal(total);
        pr.setRows(rows);
        return pr;
    }
}
